package pkg

import (
	"context"
	rabbitMQ "demo/internal/common/rabbitmq"
	"demo/internal/config"
	"demo/internal/logic"
	"demo/internal/svc"
)

func MqAnswerGet(c config.Config, ctx context.Context, svcCtx *svc.ServiceContext) {
	// //add lisener
	//logx.Infof("host:==%v", host)
	mqRB := rabbitMQ.NewOptMq(svcCtx.Config.Rabbit.Url)
	// mq := mqRB.InitMq(c.MQQueue.Paper, c.MQQueue.Paper, c.MQQueue.PaperKey)
	l := logic.NewAnswerCreateLogic(ctx,svcCtx)
	mqRB.AmqphandlerDirect(c.MQQueue.AnswerQueue, c.MQQueue.DirectExchange, c.MQQueue.AnswerRoutingKey, l.SaveDataInMon, true)
}